using Engine;
using Game;

namespace RuthlessConquest {
    public class MessageWidget : CanvasWidget {
        public LabelWidget LabelWidget;

        public double MessageTime;

        public MessageWidget() {
            HorizontalAlignment = WidgetAlignment.Center;
            IsHitTestVisible = false;
            IsVisible = false;
            LabelWidget = new LabelWidget { DropShadow = true };
            Children.Add(LabelWidget);
        }

        public void SetMessage(string text, Color color) {
            MessageTime = Time.FrameStartTime;
            LabelWidget.Text = text;
            LabelWidget.Color = color;
            IsVisible = true;
        }

        public void ClearMessage() {
            IsVisible = false;
        }
    }
}